package cim3d.util;

import net.sourceforge.ftgl.glfont.*;

import java.awt.*;

/**
 * Created by IntelliJ IDEA.
 *
 * @author Dong Shufeng
 *         Date: 2009-10-25
 */
public class FTGLUtil {
    public static final int FTGL_BITMAP = 0;
    public static final int FTGL_PIXMAP = 1;

    public static final int FTGL_OUTLINE = 2;
    public static final int FTGL_POLYGON = 3;
    public static final int FTGL_EXTRUDE = 4;
    public static final int FTGL_TEXTURE = 5;

    public static FTFont createFTFont(Font font, int type) {
        switch (type) {
            case FTGL_BITMAP:
                return new FTGLBitmapFont(font, FTFont.STANDARDCONTEXT);
            case FTGL_PIXMAP:
                return new FTGLPixmapFont(font, FTFont.STANDARDCONTEXT);
            case FTGL_OUTLINE:
                return new FTGLOutlineFont(font, FTFont.STANDARDCONTEXT);
            case FTGL_POLYGON:
                return new FTGLPolygonFont(font, FTFont.STANDARDCONTEXT);
            case FTGL_EXTRUDE:
                FTGLExtrdFont f = new FTGLExtrdFont(font, FTFont.STANDARDCONTEXT);
                f.setDepth(2f);
                return f;
            case FTGL_TEXTURE:
                return new FTGLTextureFont(font, FTFont.STANDARDCONTEXT);
            default:
                System.out.println("Not support this type : " + type);
                return null;
        }
    }

    public static FTFont createExtrdFont(Font font, float depth) {
        FTGLExtrdFont f = new FTGLExtrdFont(font, FTFont.STANDARDCONTEXT);
        f.setDepth(depth);
        return f;
    }
}
